<?php
ob_start();
session_start();
ob_clean();
include_once('../common/init.php');
include_once(DIR_CONTROL."ctl_main.php");
$objMain = new Ctl_Main($db);
$modul = CM_getParameter(MODUL);
$_SESSION["carttt"] = isset($_SESSION["carttt"])?$_SESSION["carttt"]:0;
$_SESSION["cartht"] = isset($_SESSION["cartht"])?$_SESSION["cartht"]:0;

include_once(DIR_MODEL."md_setting_web.class.php");
$objModel = new MD_SettingWeb($db);
$arrayDataSettingWeb = $objModel->getByWhere("*","");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title><?=$arrayDataSettingWeb[0]['title_web']?></title>
<meta name="description" content="<?=$arrayDataSettingWeb[0]['description']?>">
<meta name="keywords" content="<?=$arrayDataSettingWeb[0]['keyword']?>">
<?
unset($arrayDataSettingWeb);
?>
<link rel="shortcut icon" href="../images/icon.ico" type="image/x-icon">
<link rel="stylesheet" type="text/css" href="../css/Style.css" media="all" />
<link rel="stylesheet" type="text/css" href="../css/left_style.css" media="all" />
<link rel="stylesheet" type="text/css" href="../css/content.css" media="all" />
<link rel="stylesheet" type="text/css" href="../css/trangtri.css" media="all" />
<link rel="stylesheet" type="text/css" href="../css/hearder.css" media="all" />
<link rel="stylesheet" type="text/css" href="../css/menu.css" media="all" />
<link rel="stylesheet" type="text/css" href="../css/enews_front_end.css" media="all" />
<link rel="stylesheet" type="text/css" href="../css/stickytooltip.css" />

<!--[if lte IE 6]>
<link rel="stylesheet" type="text/css" href="../css/style_ie6.css" media="all" />
<![endif]--> 
<!--[if gte IE 7]>
<link rel="stylesheet" type="text/css" href="../css/style_ie7.css" media="all" />
<link rel="stylesheet" type="text/css" href="../css/menu_ie7.css" media="all" />
<![endif]--> 
<!--[id lte IE7]>
<style type="text/css">
	#contenner{
		height:100%;
	}
</style>
<![endif]-->
<!--[if gte IE 8]>
<link rel="stylesheet" type="text/css" href="../css/menu_ie8.css" media="all" />
<![endif]-->

<script type="text/javascript" src="../javascript/iepngfix_tilebg.js"></script>
<script type="text/javascript" src="../javascript/sendMail.js"></script>
<script type="text/javascript" src="../javascript/smcajax.js"></script>
<script type="text/javascript" src="../javascript/functions.js"></script>
<!-- <script type="text/javascript" language="JavaScript" src="http://vnexpress.net/Service/Gold_Content.js"></Script>
<script type="text/javascript" language="JavaScript" src="http://vnexpress.net/Service/Forex_Content.js"></Script> -->
<script type="text/javascript" language="JavaScript" src="../javascript/boxover.js"></Script>
<script type="text/javascript" language="JavaScript" src="../javascript/jquery.js"></script>
<script type="text/javascript" language="JavaScript" src="../javascript/slide.js"></script>
<script type="text/javascript" language="javascript" src="../jquery_list_home/jquery-1_002.js"></script>
<script type="text/javascript" language="javascript" src="../jquery_list_home/jquery-1.js"></script>
<script type="text/javascript" language="javascript" src="../jquery_list_home/chrome.js"></script>
<script type="text/javascript" language="javascript" src="../jquery_list_home/jcarousellite_1.js"></script>
<script type="text/javascript" src="../javascript/stickytooltip.js"></script>
<script>
	
	jQuery(document).ready(function() {
	jQuery("#frm_email").submit(function(){
		if (!isValidEmailAddress(jQuery(".txt_enter_email").val()))
			alert("Vui lòng nhập vào 1 địa chỉ Email hợp lệ.");
		else
		{
			jQuery("#btn_submit").hide();
			jQuery("#guidi").show();
			$.post("email.php",$(this).serialize(),function(data){if (data=="ok") alert("Email đã được lưu vào hệ thống."); else alert("Đã có email "+data+" trong hệ thống.\nVui lòng nhập Email khác."); jQuery("#guidi").hide(); jQuery("#btn_submit").show()});
			jQuery(".txt_enter_email").val("");
		}
		return false;
	});
  });
</script>
</head>
<body>
<!-- <DIV id="TipLayer" style="visibility:hidden;position:absolute;z-index:1000;top:-100"></DIV> -->

<!--Begin-->
<!--Contenner begin-->
<div id="contenner">
	<div id="body">
	<!--Begin page-->
	  <div id="page">
		  <!--Begin hearder-->
		  <div id="hearder">
		  	<? include_once("../includes/i_header.php");?>
		  </div>
		  <!--Begin main-->
	      <div id="main" class="clearfix">
            <!--Begin left-->
            <div id="left">
              <div class="title"><div class="title2"><p class="class1">MENU SẢN PHẨM</p></div></div>  
			  <div class="menu"><? include_once("../includes/i_menuleft.php");?></div>            
              <div class="bg_l_b">
			  	<div class="bg_r_b">
					<div class="bg_c_b">
						
					</div><!-- bg_c_b -->
				</div><!-- bg_r_b -->
			  </div><!-- bg_l_b -->
			  <!-- Begin download bang gia -->
              <div style="padding:10px 0">
			  <?
			  // Get data
			include_once(DIR_MODEL."md_download_bao_gia.class.php");
			$objModelBBG = new MD_DownloadBaogia($db);
			$arrayData_Baogia = $objModelBBG -> getByWhereLimit("*","","ngay_dang desc","0,1");
			  ?>
			  <a href="?modul=download&action=List">
			  <img src="../images/download.jpg" alt="Download" title="Download" />
			  </a>
              <?
			  unset($arrayData_Baogia);
			  ?>
			  </div>
  			  <!--  End download bang gia -->
                            <!-- Begim Support Online-->
              <div class="title"><div class="title2"><p class="class1">HỖ TRỢ TRỰC TUYẾN</p></div></div>
              <div id="sidebar">
              		<table width="100%" cellpadding="0" cellspacing="0" border="0" class="c_hotro">
 						<?
							global $db;
							include_once(DIR_MODEL."md_ho_tro.class.php");
							$objHotro = new MD_Hotro($db);
							$arrayData_Hotro0 =  array();
							$arrayData_Hotro1 =  array();
							$arrayData_Hotro2 =  array();
							
							$arrayData_Hotro0 = $objHotro->getByWhere("*","hien_thi =1 and linh_vuc_ho_tro=0","id desc");  
							$arrayData_Hotro1 = $objHotro->getByWhere("*","hien_thi =1 and linh_vuc_ho_tro=1","id desc");   
							$arrayData_Hotro2 = $objHotro->getByWhere("*","hien_thi =1 and linh_vuc_ho_tro=2","id desc"); 
							
							$sophone = array();
							if(!empty($arrayData_Hotro1)){
						?>
									<tr>
                                    	<td colspan="4" align="center"><br /><b>Phòng kinh doanh</b></td>
                                    </tr>
                                    <tr>
                                    	<td colspan="4" align="center" height="5px"><img src="../images/kc-1.png" /></td>
                                    </tr>
						<?
								$stt = 0;
								echo "<tr>";
								foreach($arrayData_Hotro1 as $rowHT1){
									$stt++;
									if ($stt>2)
									{
										echo "</tr><tr><td colspan=2 class=\"phone\">".$sophone[1]."</td><td colspan=2 class=\"phone\">".$sophone[2]."</td></tr><tr>";
										$stt=1;
									}
									$sophone[$stt] = $rowHT1["dt_di_dong"];
						?>
                                    	<td align="center">
                                        	<a title="Hỗ trợ trực tuyến" href="ymsgr:sendIM?<?=$rowHT1['yahoo_id']?>" rel="nofollow"><?=$rowHT1['ten']?></a>
                                        </td>
										<td align="center">
											<a title="Hỗ trợ trực tuyến" href="ymsgr:sendIM?<?=$rowHT1['yahoo_id']?>" rel="nofollow"><img border=0 src="../images/yho.png"></a>
										</td>
						<?
								}
								echo "</tr><tr><td colspan=2 class=\"phone\">".$sophone[1]."</td>".($stt>1?"<td colspan=2 class=\"phone\">".$sophone[2]."</td>":"")."</tr>";
							}
							if(!empty($arrayData_Hotro0)){
						?>
									<tr>
                                    	<td colspan="4" align="center"><br /><b>Hỗ trợ kỹ thuật</b></td>
                                    </tr>
                                    <tr>
                                    	<td colspan="4" align="center" height="5px"><img src="../images/kc-1.png" /></td>
                                    </tr>
						<?
								$stt = 0;
								echo "<tr>";
								foreach($arrayData_Hotro0 as $rowHT0){
									$stt++;
									if ($stt>2)
									{
										echo "</tr><tr><td colspan=2 class=\"phone\">".$sophone[1]."</td><td colspan=2 class=\"phone\">".$sophone[2]."</td></tr><tr>";
										$stt=1;
									}
									$sophone[$stt] = $rowHT1["dt_di_dong"];
						?>
										<td align="center">
                                        	<a title="Hỗ trợ trực tuyến" href="ymsgr:sendIM?<?=$rowHT0['yahoo_id']?>" rel="nofollow"><?=$rowHT0['ten']?></a>
                                        </td>
										<td align="center">
											<a title="Hỗ trợ trực tuyến" href="ymsgr:sendIM?<?=$rowHT0['yahoo_id']?>" rel="nofollow"><img border=0 src="../images/yho.png"></a>
										</td>
						<?
								}
								echo "</tr><tr><td colspan=2 class=\"phone\">".$sophone[1]."</td>".($stt>1?"<td colspan=2 class=\"phone\">".$sophone[2]."</td>":"")."</tr>";
							}
							if(!empty($arrayData_Hotro2)){
						?>
                        			<tr>
                                    	<td colspan="4" align="center"><br /><b>Hỗ trợ Bảo hành</b></td>
                                    </tr>
                                    <tr>
                                    	<td colspan="4" align="center" height="5px"><img src="../images/kc-1.png" /></td>
                                    </tr>
						<?
                        		$stt = 0;
								echo "<tr>";
								foreach($arrayData_Hotro2 as $rowHT2){
									$stt++;
									if ($stt>2)
									{
										echo "</tr><tr><td colspan=2 class=\"phone\">".$sophone[1]."</td><td colspan=2 class=\"phone\">".$sophone[2]."</td></tr><tr>";
										$stt=1;
									}
									$sophone[$stt] = $rowHT1["dt_di_dong"];
						?>
										<td align="center">
                                        	<a title="Hỗ trợ trực tuyến" href="ymsgr:sendIM?<?=$rowHT2['yahoo_id']?>" rel="nofollow"><?=$rowHT2['ten']?></a>
                                        </td>
										<td align="center">
											<a title="Hỗ trợ trực tuyến" href="ymsgr:sendIM?<?=$rowHT2['yahoo_id']?>" rel="nofollow"><img border=0 src="../images/yho.png"></a>
										</td>
						<?
								}
								echo "</tr><tr><td colspan=2 class=\"phone\">".$sophone[1]."</td>".($stt>1?"<td colspan=2 class=\"phone\">".$sophone[2]."</td>":"")."</tr>";
							}
						?>
                   		</table>
                   </div>
                <div class="bg_l_b"><div class="bg_r_b"><div class="bg_c_b"></div></div></div>
                <br />
                <div class="title"><div class="title2"><p class="class1">TIN TỨC</p></div></div>
                <div id="sidebar">
                	<table border="0" cellpadding="0" cellspacing="0" width="100%" class="c_news">
                <?
					include_once(DIR_MODEL."md_tintuc.class.php");
					$objTintuc = new MD_Tintuc($db);
					$arrayData_Tintuc =  array();
					$arrayData_Tintuc = $objTintuc->getByWhereLimit("*","","ngay_tao desc","0,5");
					$tong = sizeof($arrayData_Tintuc);
					if(!empty($arrayData_Tintuc))
						foreach($arrayData_Tintuc as $rowTT)
						{
				?>
						<tr style="display:block; padding-top:10px; ">
							<td  style="width:70px; text-align:center; ">
							<a href="?modul=tintuc&action=View&id=<?=$rowTT['id']?>">
								<?
								if(!empty($rowTT["anh"])){
									$exists = file_exists('../admin/images/images_upload/'.$rowTT["anh"]);
									
									if($exists){
								?>
									<img src="../admin/images/images_upload/<?=$rowTT["anh"]?>"  class="image_thumb_news" style="width:50px; " border="0"/>
								
								<?
									}else{
								?>
									<img src="../images/no_image_130.jpg"  class="image_thumb_news" style="width:50px; " border="0"/>
								<?
									}
								}else{
								?>
								
								<img src="../images/no_image_130.jpg"  class="image_thumb_news" style="width:50px; " border="0"/>
								
								<?
								}
								?>
								</a>
							</td>					
							<td valign="top">
								<span class="title_intro_news"><?=cut_string($rowTT['tieu_de'],20,1)?></span><br />
								<span class="noidung_intro_news"><?=cut_string($rowTT["tom_tat"],50,1)?></span>
							</td>		
						</tr>
						<tr>
							<td colspan="2" class="chitiet" align="right">
								<a href="?modul=tintuc&action=View&id=<?=$rowTT['id']?>"> --> Chi tiết </a>
							</td>
						</tr>
				<?							
							$tong--;
							if ($tong) echo "<tr><td colspan=2><hr style=\"border: 0.1em dashed #015a60\"/></td></tr>";
						}
				?>
                	</table>
                </div>
                <div class="bg_l_b"><div class="bg_r_b"><div class="bg_c_b"></div></div></div>
                <br />
                <div class="title"><div class="title2"><p class="class1">ĐĂNG KÝ NHẬN TIN</p></div></div>
                <div id="sidebar">
                <form id="frm_email" method="post" style="margin-bottom:0px; margin-top:0px; ">
                	<p class="title_enter_email">Nhập địa chỉ Email:</p>
                    <input type="text" name="enteremail" class="txt_enter_email" />
                    <div id="guidi" style="display:none">Vui lòng chờ một lát.</div>
					<div id="btn_submit">
					<input type="submit" value="Gửi đi" class="btn_enter_email" />
					</div>
                </form>
                </div>
                <div class="bg_l_b"><div class="bg_r_b"><div class="bg_c_b"></div></div></div>
                <br />
            </div>
	        <!--End left-->
            <!--Begin content-->
            <div id="content">
				<div id="divError"></div>
            	<div id="divMain"><?php $objMain->execute("");?></div>
            </div>
	        <!--End content-->
            <div style="clear:both"></div>
            <div id="footer"><?	include_once("../includes/i_footter.php");?></div>
	        <!--End main-->
          </div>
	  </div>
</div>
</div>
<!--End-->
</body>
</html>